<?php

namespace app\admin\validate;
use think\Validate;

class Admin extends Validate
{
    protected $rule = [
        'user_name'         => 'require|alphaDash|unique:admin',
        'nick_name'         => 'require|max:50|unique:admin',
        'mobile_phone'      => 'require|mobile|unique:admin',
        //'group_id'        => 'require',
    ];

    protected $message = [
        'user_name.require'     => '用户名不能为空',
        'user_name.unique'      => '用户名已存在',
        'user_name.alphaDash'   => '用户名格式不正确',
        'nick_name.max'         => '姓名最多不能超过50个字符',
        'nick_name.unique'      => '姓名已存在',
        'mobile_phone.phone'    => '手机号格式不正确',
        'mobile_phone.unique'   => '手机号已存在',
        //'group_id'            => '请选择用户组',
    ];
}
